﻿function Get-LastSync ([array] $auser = @("david.ray@chw.edu")) {
	$auser | 
	ForEach-Object {Get-ActiveSyncDeviceStatistics -mailbox $_} | 
	Where-Object { $_.LastSuccessSync -gt "10/1/2010" } | 
	Format-Table Identity,@{n="Last Sync";e={$_.LastSuccessSync.AddHours(-5)}},@{n="How Recent";e={"{0:N1} Minutes" -f (New-TimeSpan -End (Get-Date).AddHours(2) -Start $_.LastSuccessSync.AddHours(-5)).TotalMinutes}},DeviceUserAgent
}
